import { Text } from '@tarojs/components';
import styles from './style.scss';
import React from 'react';

export type Props = {
  children?: React.ReactNode;
  type?:
    | 'info'
    | 'success'
    | 'warning'
    | 'danger'
    | 'blue'
    | 'province'
    | 'city'
    | 'district'
    | 'street'
    | 'community';
  className?: string;
  dot?: boolean;
};

export default (props: Props) => {
  const { children, className = '', type = 'info', dot } = props;
  return (
    <Text
      className={`${styles.tag} ${dot ? styles.dot : ''} ${
        styles[type]
      } ${className}`}
    >
      {children}
    </Text>
  );
};
